<%@ include file="/WEB-INF/jsp/includes/includes.jsp" %>

<%
	String current = request.getParameter("current");
%>

<!-- navigation -->
<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
      <a class="brand" href="<%=request.getContextPath()%>/index.html">Tuppence</a>
      <div class="nav-collapse">
        <ul class="nav">
          <sec:authorize ifAnyGranted="ROLE_USER">
          <li <%if("home".equalsIgnoreCase(current)){%>class="active"<%}%>><a href="<spring:url value='/app/home.html' htmlEscape='true'/>">Home</a></li>
          </sec:authorize>
          <sec:authorize ifNotGranted="ROLE_USER">
          <li <%if("home".equalsIgnoreCase(current)){%>class="active"<%}%>><a href="<spring:url value='/index.html' htmlEscape='true'/>">Home</a></li>
          </sec:authorize>
          <li <%if("about".equalsIgnoreCase(current)){%>class="active"<%}%>><a href="<spring:url value='/docs/about.html' htmlEscape='true'/>">About</a></li>
          <li <%if("contact".equalsIgnoreCase(current)){%>class="active"<%}%>><a href="<spring:url value='/docs/contact.html' htmlEscape='true'/>">Contact</a></li>
		 </ul>
		 
		 <sec:authorize ifAnyGranted="ROLE_USER">
	         <ul class="nav pull-right">
	         	<li><a href="<spring:url value='/logout' htmlEscape='true'/>">Logout</a></li>
	         </ul>
		 </sec:authorize>
		 
		 <sec:authorize ifNotGranted="ROLE_USER">
		 	<%if(!"login".equalsIgnoreCase(current) && !"register".equalsIgnoreCase(current)) {%>
         		<ul class="nav pull-right">
          			<li><a href="<spring:url value='/login.html' htmlEscape='true'/>">Login</a></li>
          			<li><p>or</p></li>
          			<li><a href="<spring:url value='/login.html' htmlEscape='true'/>">Register</a></li>
        		</ul>
        	<%}%>
         </sec:authorize>
      </div><!--/.nav-collapse -->
    </div>
  </div>
</div>